package com.huisang.springboot.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huisang.springboot.controller.dto.UserDTO;
import com.huisang.springboot.entity.User;
import com.huisang.springboot.utils.Result;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.ServletOutputStream;
import java.util.List;

public interface UserService extends IService<User> {

    User getUserByName(String username);

    User getUserById(Integer id);

    Result<UserDTO> login(UserDTO userDTO);

    Result<Boolean> insertUser(User user);

    Result<Boolean> deleteUser(Integer id);

    Result<Boolean> deleteBatchUser(List<Integer> ids);

    Result<Boolean> updateUser(User user);

    Result<List<User>> getUserList();

//    Result<Map<String, Object>> getUserPageList(Integer pageNum, Integer pageSize);
    Result<IPage<User>> getUserPageList(Integer pageNum, Integer pageSize, String username);

    void export(ServletOutputStream outputStream);

    void importEx(MultipartFile file);

}
